package com.entor.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.entor.dao.PartymemberDaoI;
import com.entor.model.Msg;
import com.entor.model.Notice;
import com.entor.model.Partymember;

@Service
public class PartymemberService implements BaseServiceI<Partymember>{

	@Autowired
	private PartymemberDaoI pms;
	
	
	public List<Partymember> find(Partymember t) {
		
		List<Partymember> list = pms.find(t);
		
		return list;
	}

	public Partymember get(Partymember t) {
		
		List<Partymember> list = pms.find(t);
		return list.size()>0?list.get(0):new Partymember();
		
	}

	public Msg insert(Partymember t) {
		
		Msg  m = new Msg("新增失败!",false);
		int i = pms.insert(t);
		if(i>0){
			m = new Msg("新增成功!",true);
		}
		return m;
		
	}

	public Msg batchInsert(String objs) {
		// TODO Auto-generated method stub
		return null;
	}

	public Msg edit(Partymember t) {
		
		Msg  m = new Msg("修改失败!",false);
		int i = pms.edit(t);
		if(i>0){
			m = new Msg("修改成功!",true);
		}
		return m;
	}

	public Msg remove(Integer id) {
	
		Msg  m = new Msg("删除失败!",false);
		int i = pms.remove(id);
		if(i>0){
			m = new Msg("删除成功!",true);
		}
		return m;
	}

	public Msg batchRemove(String ids) {
		// TODO Auto-generated method stub
		return null;
	}

}
